package SwingStudy;

import javax.swing.*;
import java.awt.*;

public class FlowLayoutTest extends JFrame {
    //JPanel默认的布局方式就是流布局
    JPanel jPanel = new JPanel(new FlowLayout(FlowLayout.CENTER, 120, 400));
    JButton Logup = new JButton("注册");
    JButton Login = new JButton("登录");
    JButton Exit = new JButton("退出");


    public FlowLayoutTest() {
        super("测试流布局");

        Container contentPane = getContentPane();

        jPanel.add(Logup);
        jPanel.add(Login);
        jPanel.add(Exit);

        contentPane.add(jPanel);

        setSize(1000, 600);
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);
    }

    public static void main(String[] args) {
        new FlowLayoutTest();
    }
}
